//路由懒加载
import loadable from 'react-loadable'
// import {redirect} from 'react-router-dom'

//过场组件
const loading = () => {
    return (
        <div>正在加载...</div>
    )
}

const routes = [
    {
        name: "home",
        path: "/home",
        component: loadable({ loader: () => import('../page/home'), loading }),
        children: [
            {
                name: 'housing',
                path: "/home/housing",
                component: loadable({ loader: () => import('../page/home/housing/index'), loading }),
                title:'房源信息',
                icon:'<AppstoreOutlined/>',
            },
            {
                name: 'housing2',
                path: "/home/housing2",
                component: loadable({ loader: () => import('../page/home/housing2/index'), loading }),
            },
            {
                name: 'detail',
                path: "/home/detail",
                component: loadable({ loader: () => import('../page/home/detail/index'), loading }),
            },
            {
                name: 'live',
                path: "/home/live",
                component: loadable({ loader: () => import('../page/home/live/index'), loading }),
                title:'直播管理',
                icon:'MobileOutlined',
            },
            {
                name: 'group',
                path: "/home/group",
                component: loadable({ loader: () => import('../page/home/group/index'), loading }),
                title:'团购管理',
                icon:'FundProjectionScreenOutlined'
            },
            {
                name: 'check',
                path: "/home/check",
                component: loadable({ loader: () => import('../page/home/check/index'), loading }),
                title:'审核管理',
                icon:'FundProjectionScreenOutlined'
            },
            {
                name: 'order',
                path: "/home/order",
                component: loadable({ loader: () => import('../page/home/order/index'), loading }),
                title:'订单管理',
                icon:'FundProjectionScreenOutlined'
            },
            {
                name: 'consult',
                path: "/home/consult",
                component: loadable({ loader: () => import('../page/home/consult/index'), loading }),
                title:'资讯管理',
                icon:'FundProjectionScreenOutlined'
            },
            {
                name: 'broker',
                path: "/home/broker",
                component: loadable({ loader: () => import('../page/home/broker/index'), loading }),
                title:'经纪人管理',
                icon:'FundProjectionScreenOutlined'
            }
        ]
    },
    {
        name:'login',
        path:'/login',
        component:loadable({loader:()=>import('../page/login'),loading}),
    }
]

export default routes